package com.my.zidingyikongjian.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.FrameLayout;

import com.my.zidingyikongjian.R;
import com.my.zidingyikongjian.view.two.DrawText;

public class TextActivity extends AppCompatActivity {
    private FrameLayout fl;
    private String flag;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_text);
        Intent dataIntent = getIntent();
        flag = dataIntent.getStringExtra("two");
        initView();
    }

    private void initView() {
        fl = findViewById(R.id.fl_text);

        if (flag.equals("8")) { // 文字三种样式
            fl.addView(new DrawText(this, 0));
        } else if (flag.equals("9")) { // 斜体
            fl.addView(new DrawText(this, 1));
        } else if (flag.equals("10")) { // 斜体
            fl.addView(new DrawText(this, 2));
        } else if (flag.equals("11")) { // 自定义文字位置
            fl.addView(new DrawText(this, 3));
        } else if (flag.equals("12")) { // 自定义文字位置
            fl.addView(new DrawText(this, 4));
        }else if (flag.equals("13")) { // 自定义文字位置
            fl.addView(new DrawText(this, 5));
        }
    }


}
